package cn.edu.wynu;


import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.stereotype.Component;

@Component
public class BookHandler {
    public void addBook() {
        System.out.println("添加图书!");
    }

    public void updateBook() {
        System.out.println("更新图书!");
    }

    public void deleteBook() {
        System.out.println("删除图书!");
    }

    public void selectBook() {
        System.out.println("查询图书!");
    }


    public static void main(String[] args) {
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext(MyBookConfig.class);

        BookHandler bookHandler = context.getBean(BookHandler.class);
        bookHandler.addBook();
        bookHandler.deleteBook();
        bookHandler.selectBook();
        bookHandler.updateBook();
    }
}
